#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<errno.h>
#include<fcntl.h>
#include<unistd.h> 
#include<pthread.h>


int
main(void)
{
	char* path = "text.txt";
		
	open(path, O_RDONLY | O_CREAT, 0555);

	if(!access(path, F_OK)){
		printf("file can be exist\n");
	}
	else{
		perror("file cannot be exist");
	}

	if(!access(path, R_OK)){
		printf("file can be read\n");
	}
	else{
		perror("file cannot be read");
	}

	if(!access(path, W_OK)){
		printf("file can be writed\n");
	}
	else{
		perror("file cannot be writed");
	}

	if(!access(path, X_OK)){
		printf("file can be extence\n");
	}
	else{
		perror("file cannot be extence");
	}
	
	return 0;

}
